/*
 * Group 3, User Interface Programming II (vt11)
 * Pooya | Flora | Monica | Can
 */
package vical.action;

import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import vical.model.Internationalization;
import vical.view.ViewPanel;

/**
 * The Action to navigate to the previous View
 * @author Can
 */
public class ViewPreviousAction extends AbstractAction {

    private ViewPanel viewPanel;

    private ViewPreviousAction() {
    }

    public ViewPreviousAction(ViewPanel viewPanel) {
        super("◀");
        putValue(MNEMONIC_KEY, Internationalization.getMnemonic("mnemonics_navigation_bar_previous_button"));
        this.viewPanel = viewPanel;
    }

    public void actionPerformed(ActionEvent e) {
        this.viewPanel.previous();
    }
}
